IndA=17;
IndB=18;

numbins=params.par(1).range;
    
    binReduction=2^8;
    %For FCS 3.0 files data is collected in 2^18 bins.  This reduces the
    %bins to 2^10 in size
    numScaledBins=numbins/binReduction;
    
    dens = zeros(numScaledBins,numScaledBins);
    
    %This rebins the data, by increasing the count in an index of a matix.
    %The bins are resized so the matix is not incredibly large
    for i=1:length(data(:,1))
        x = max(fix(data(i,IndA)/binReduction),1);
        y = max(fix(data(i,IndB)/binReduction),1);
        dens(y,x) = dens(y,x) + 1;
    end
  
    fsc_axis = 0:1:(numScaledBins-1);
    fl1_axis = 0:1:(numScaledBins-1);
    
    gca=imagesc(fsc_axis, fl1_axis, log(dens+1), [0 4]);
    axis xy
    %xlabel(params.par(IndA).name);
    %ylabel(params.par(IndB).name);
    title(params.filename);
    
% clear hist2
%  
%  
% MX_N = 100;
% 
% FSCH=1;
% GFPH=7;
%  
% x = data(:,FSCH);
% y = data(:,GFPH);
%  
% x = min(MX_N, floor(MX_N.*x./max(x)));
% y = min(MX_N, floor(MX_N.*y./max(y)));
%  
%  
% xyind = [x(:) y(:)];
% xyind = sortrows(xyind,2);
% xyind = sortrows(xyind,1);
% bins = [1:MX_N];
% for ii=1:MX_N
% %     ii/MX_N
%     histtemp = hist((xyind(:,1)==ii).*xyind(:,2), bins);
%     hist2(ii,:) = histtemp(2:end);
% end
%  
% imagesc(hist2)
 
